class Solution:
    def findNthDigit(self, n: int) -> int:
        k = 9
        i = 1
        start = 1
        while n > k * start * i:
            n = n - k * start * i
            i += 1
            start *= 10
        return int(list(str(start + (n - 1) // i))[(n - 1) % i])


if __name__ == '__main__':
    so = Solution()
    n = 11
    r = so.findNthDigit(n)
    print(r)
